<?php
	include "./utils/auth.php";
	if (!(isset($_GET['cid'])))
	{
		die("no cid given");
	}
?>
<table width="100%">
  <thead>
  <tr style="font: 18px Arial,Verdana,sans-serif;">
  	<td>Name</td>
  	<td>Account-ID</td>
  </tr>
</thead>
<tbody>
<?php //INNER JOIN wottools.wotcwchannel w ON ( c.concernedchannel = w.`channelid`  )  
$abfrage = 
"SELECT DISTINCT wotaccountname, wotaccountid
FROM wottools.combatants c 
	INNER JOIN wottools.users u ON ( c.userid = u.`id`  )  
	INNER JOIN wottools.wotcwchannel w ON ( c.concernedchannel = w.`channelid`  AND c.fc = w.fc)  
WHERE w.`channelid`= ? AND c.reserve= ?";

if(!($stmt = $db->prepare($abfrage)))
{
	echo "camt prep statement ".$db->error;
}
$stmt->bind_param("ii",$_GET['cid'],$_GET['reserve']);
if(!($stmt->execute()))
{
	echo("cannot execute statement");
	return;
}
$stmt->bind_result($wotaccountname,$wotaccountid);
while($stmt->fetch())
{
  echo '<tr>';
  echo '<td width="10%">';
  echo $wotaccountname;
  echo '</td>';
  echo '<td width="10%">';
  echo $wotaccountid;
  echo '</td>';
  echo '</tr>';
}
$stmt->close();
  ?>
  </tbody>
</table>















